package com.example.dllo.moondog.information.strategy;

import android.content.Intent;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.example.dllo.moondog.R;
import com.example.dllo.moondog.base.BaseActivity;

/**
 * Created by dllo on 16/3/3.
 */
public class StrategyActivity extends BaseActivity {
    private WebView webView;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_strategy);
        webView = (WebView) findViewById(R.id.webView_strategy);

        Intent intent = getIntent();
        String url = intent.getStringExtra("url");
        webView.getSettings().setJavaScriptEnabled(true);
        webView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return true;
            }
        });
        webView.loadUrl(url);
    }
}

//    @Override
//    public void setContentView(int layoutResID) {
//        super.setContentView(layoutResID);
//        setContentView(R.layout.activity_strategy);
//        webView = (WebView) findViewById(R.id.webView_strategy);
//
//        Intent intent = getIntent();
//        String url = intent.getStringExtra("url");
//        webView.getSettings().setJavaScriptEnabled(true);
//        webView.setWebViewClient(new WebViewClient() {
//            @Override
//            public boolean shouldOverrideUrlLoading(WebView view, String url) {
//                view.loadUrl(url);
//                return true;
//            }
//        });
//        webView.loadUrl(url);
//    }

